use crate::c::rtx_os::{osDelay, osKernelGetTickCount, osKernelInitialize, osKernelStart};

#[inline(always)]
pub unsafe fn os_kernel_initialize() {
    osKernelInitialize();
}

#[inline(always)]
pub unsafe fn os_kernel_start() {
    osKernelStart();
}

#[inline(always)]
pub fn os_kernel_get_tick_count() -> u32 {
    unsafe { osKernelGetTickCount() }
}

#[inline(always)]
pub unsafe fn system_init() {
    #[cfg(feature = "cm3")]
    {
        use super::c::stm32f10x::SystemInit;
        SystemInit();
    }

    #[cfg(any(feature = "cm4", feature = "cm4_25"))]
    {
        use super::c::stm32f4xx::SystemInit;
        SystemInit();
    }
}

#[inline(always)]
pub fn os_delay(tick: u32) {
    unsafe { osDelay(tick); }
}

